<?php
namespace admin\action;

use herosphp\http\HttpRequest;
use herosphp\utils\AjaxResult;
use herosphp\bean\Beans;

/**--tmpl-use--**/

class AdCateAction extends CommonAction {

	protected $serviceBean="information.informationAdCate.service";
	private $bread = array('信息管理','广告管理');
	private $breadUrl = array('javascript:;','javascript:;');

	public function C_start()
	{
		parent::C_start();
	}

	public function add(HttpRequest $request) {
	
		parent::add($request);
		$this->assign("title", "广告类型列表");
		$this->assign('bread',$this->bread);
		$this->assign('breadUrl', $this->breadUrl);
	
	}

	public function edit(HttpRequest $request) {
		parent::edit($request);
		$this->assign("title", "广告类型列表");
		$this->assign('bread',$this->bread);
		$this->assign('breadUrl', $this->breadUrl);
	}
	public function index(HttpRequest $request) {
		$conditions = array();
		$this->assign('_table','广告类型');
		$s_name = $request->getParameter('s_name');
		$this->assign('s_name',$s_name);
		if($s_name !== '' && $s_name!== NULL)$conditions['name'] = '%'.$s_name.'%';
		$s_parent_id = $request->getParameter('s_parent_id');
		$this->assign('s_parent_id',$s_parent_id);
		if($s_parent_id !== '' && $s_parent_id!== NULL)$conditions['parent_id'] = '%'.$s_parent_id.'%';
		$s_summary = $request->getParameter('s_summary');
		$this->assign('s_summary',$s_summary);
		if($s_summary !== '' && $s_summary!== NULL)$conditions['summary'] = '%'.$s_summary.'%';
		$s_manager_id = $request->getParameter('s_manager_id');
		$this->assign('s_manager_id',$s_manager_id);
		if($s_manager_id !== '' && $s_manager_id!== NULL)$conditions['manager_id'] = '%'.$s_manager_id.'%';
		$s_app_id = $request->getParameter('s_app_id');
		$this->assign('s_app_id',$s_app_id);
		if($s_app_id !== '' && $s_app_id!== NULL)$conditions['app_id'] = '%'.$s_app_id.'%';
		$this->assign('_filter',array('name','information_ad_cate_id','summary','admin_manager_id','app_id'));
		$this->assign('_header',array('','上级分类','分类描述','','AppId'));
		$this->setConditions($conditions);
	
		$pagesize = $request->getParameter('pagesize') ? $request->getParameter('pagesize') : $this->getPagesize();
		$order = $request->getParameter('order') ? $request->getParameter('order') : $this->getOrder();
		$order = str_replace('+' , " ",$order);
		$this->setPagesize($pagesize);
		$this->setOrder($order);
		$this->assign('order',$order);
		$this->assign('pagesize',$pagesize);
		parent::index($request);
		$this->assign("title", "广告类型列表");
		$this->assign('bread',$this->bread);
		$this->assign('breadUrl', $this->breadUrl);
	}
	public function do_add(HttpRequest $request)
	{
		$data = $request->getParameter('data');
		$request->addParameter('data',$data);
		parent::do_add($request);	
	}
	public function do_edit(HttpRequest $request){
		$data = $request->getParameter('data');
		$request->addParameter('data',$data);
		parent::do_edit($request);	
	}
	
	

}
